package dev.huidocs.docs.service.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.Objects;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import javax.validation.constraints.*;
import com.gitee.coadmin.base.BaseDto;

/**
 * Accessed recently
 * @author jinjin
 * @since 2024-10-11
 */
@Getter
@Setter
@NoArgsConstructor
public class DocResAccessedRecentlyDTO extends BaseDto {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @Excel(name = "ID")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "文档资源ID")
    @Excel(name = "文档资源ID")
    @NotNull
    @JsonSerialize(using= ToStringSerializer.class)
    private Long resId;

    @ApiModelProperty(value = "同doc_res")
    @Excel(name = "同doc_res")
    @NotNull
    private Integer category;

    @ApiModelProperty(value = "同doc_res")
    @Excel(name = "同doc_res")
    @NotNull
    @JsonSerialize(using= ToStringSerializer.class)
    private Long owner;

    @ApiModelProperty(value = "最近打开人")
    @Excel(name = "最近打开人")
    @NotNull
    @JsonSerialize(using= ToStringSerializer.class)
    private Long createUser;

    @ApiModelProperty(value = "最近打开时间")
    @Excel(name = "最近打开时间")
    @NotNull
    private Date createTime;

    @ApiModelProperty(value = "首次访问时间")
    @Excel(name = "首次访问时间")
    @NotNull
    private Date updateTime;

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      DocResAccessedRecentlyDTO obj = (DocResAccessedRecentlyDTO) o;
      return Objects.equals(id, obj.id);
    }
    
    @Override
    public int hashCode() {
      return Objects.hashCode(id);
    }
}
